<hr>
<ul class="thumbnails">
	<?php
	if($data->num_rows() > 0){
		$i = 0;
		foreach($data->result_array() as $row){ 
		echo ($i % 4 == 0) ? '<div class="clear"></div>' : '';
	?>
    <li class="span3<?php echo (($i++) % 4 == 0) ? ' first-child' : ''; ?>">
        <div class="thumbnail">
        	<a href="<?php echo site_url('content/product/viewDetail/'. $row[field('id')]); ?>" title="<?php echo $row[field('name')]; ?>">
                <img src="<?php echo PRODUCT_PATH. '/' . 'thumbs/' . $row[field('image')]; ?>" alt="">
                <h6><?php echo (strlen($row[field('name')]) > 24) ? substr($row[field('name')], 0, 22) . '...' : $row[field('name')]; ?></h6>
        	</a>
            <p><?php echo (strlen($row[field('description')]) > 90) ? substr($row[field('description')], 0, 90) . '...' : $row[field('description')]; ?></p>
        </div>
    </li>
    <?php 
		}
	}
	?>
</ul>
<div class="pagination"><?php echo $this->pagination->create_links(); ?></div>